package cn.it.ygh.service.impl;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.it.ygh.mapper.UserMapper;
import cn.it.ygh.pojo.House;
import cn.it.ygh.pojo.Order;
import cn.it.ygh.pojo.User;
import cn.it.ygh.service.UserService;
@Service("userService")
public class UserServiceImpl implements UserService{

	@Resource
	UserMapper usermapper;
	
	@Override
	public User login(User u) {
		// TODO Auto-generated method stub
		return usermapper.login(u);
	}

	@Override
	public void register(User u) {
		// TODO Auto-generated method stub
		u.setUserImg("C:\\Users\\Administrator\\Desktop\\1409573918960282.jpg");
		u.setUserTime(new Date());
		usermapper.register(u);
	}

	@Override
	public void modify(User u) {
		// TODO Auto-generated method stub
		usermapper.modify(u);
	}

	@Override
	public int findRecordsTotal(String userAccount) {
		// TODO Auto-generated method stub
		return usermapper.findRecordsTotal(userAccount);
	}

	@Override
	public List<Order> findAllOrders(int pageStart, int pageSize) {
		// TODO Auto-generated method stub
		return usermapper.findAllOrders(pageStart, pageSize);
	}

	@Override
	public int findOrdersTotal() {
		// TODO Auto-generated method stub
		return usermapper.findOrdersTotal();
	}

	@Override
	public void recordModify(House h) {
		// TODO Auto-generated method stub
		usermapper.recordModify(h);
	}

	@Override
	public void delete(int houseId) {
		// TODO Auto-generated method stub
		usermapper.delete(houseId);
	}

	@Override
	public House getRecordById(int houseId) {
		// TODO Auto-generated method stub
		return usermapper.getRecordById(houseId);
	}

	@Override
	public void userImg(User u) {
		// TODO Auto-generated method stub
		usermapper.userImg(u);
	}

	@Override
	public String getPwdByUserAccount(String userAccount) {
		// TODO Auto-generated method stub
		return usermapper.getPwdByUserAccount(userAccount);
	}

	@Override
	public List<House> findAllRecords(int pageStart, int pageSize, String userAccount) {
		// TODO Auto-generated method stub
		return usermapper.findAllRecords(pageStart, pageSize, userAccount);
	}

}
